<?php
class CommentModel extends Zend_Db_Table_Abstract {
	public function selectComment( $wall_id ){
		$db = Zend_Registry::get('connectDB');
		$mysql = $db->select()
					->from( array('c'=>'comment') )
					->join( array('u'=>'user'), 'c.user_id=u.id', array('fullname'=>'u.fullname', 'avatar'=>'u.avatar') )
					->where('wall_id=?', $wall_id );
		$return = $db->fetchAll( $mysql );
		return $return;
	}
	public function save( $wall_id, $user_id, $content ){
		$db = Zend_Registry::get('connectDB');
		$data = array('wall_id'=>$wall_id, 'user_id'=>$user_id, 'content'=>$content );
		$db->insert('comment', $data);
	}
	
}